<html lang="en" xmlns:th="http://www.springframework.org/schema/data/jaxb">



<div class="layui-row">
    <form class="layui-form" id="field_form" style="margin: 20px" lay-filter="field_form">
         <input type="hidden"  th:value="${obj.id}" id="id" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label">字段名</label>
            <div class="layui-input-block">
                <input type="text" name="fieldName" id="fieldName" required  lay-verify="required"  autocomplete="off" class="layui-input" th:value="${obj.fieldName}" readonly>
            </div>
        </div>

       <!-- <div class="layui-form-item">
            <label class="layui-form-label">字段类型</label>
            <div class="layui-input-block">
                <input type="text" name="fieldType" id="fieldType" required  lay-verify="required" " autocomplete="off" class="layui-input" th:value="${obj.fieldType}" readonly>
            </div>
        </div>-->

       <!-- <div class="layui-form-item">
            <label class="layui-form-label">生成字段名</label>
            <div class="layui-input-block">
                <input type="text" name="classFieldName" id="classFieldName" required   placeholder="表对象描述" autocomplete="off" class="layui-input" th:value="${obj.classFieldName}" >
            </div>
        </div>-->


        <div class="layui-form-item">
            <label class="layui-form-label">字段描述</label>
            <div class="layui-input-block">
                <input type="text" name="fieldRemark" id="fieldRemark"  placeholder="表对象描述" autocomplete="off" class="layui-input" th:value="${obj.fieldRemark}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否列表显示</label>
            <div class="layui-input-block">
                <select name="isTable" id="isTable" placeholder="是否列表显示" th:field="${obj.isTable}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isTable==0}" value="0">不需要</option>
                    <option  th:selected="${obj.isTable==1}" value="1">需要</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否表单显示</label>
            <div class="layui-input-block">
                <select name="isForm" id="isForm"  placeholder="是否表单显示" th:field="${obj.isForm}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isForm==0}" value="0">不需要</option>
                    <option  th:selected="${obj.isForm==1}" value="1">需要</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否需要排序</label>
            <div class="layui-input-block">
                <select name="isSort" id="isSort"  placeholder="是否表单显示" th:field="${obj.isSort}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isSort==0}" value="0">不需要</option>
                    <option  th:selected="${obj.isSort==1}" value="1">需要</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">表单呈现样式</label>
            <div class="layui-input-block">
                <select name="formAway" id="formAway"  placeholder="表单呈现样式" th:field="${obj.formAway}" >
                    <option  value="">-请选择-</option>
                  <!--  0.不输入1.文字框创建 2. 密码框输入 3.数字框输入4.日期输入框输入5.日期时间输入框输入 6.单选下拉列表输入 7.多选下拉框输入 8.文本域输入  9. 图片输入 10.图片组输入,11 文件框-->
                    <option  th:selected="${obj.formAway==0}" value="0">不输入</option>
                    <option  th:selected="${obj.formAway==1}" value="1">文本框</option>
                    <option  th:selected="${obj.formAway==2}" value="2">密码框</option>
                    <option  th:selected="${obj.formAway==3}" value="3">数字框</option>
                    <option  th:selected="${obj.formAway==4}" value="4">日期输入框</option>
                    <option  th:selected="${obj.formAway==5}" value="5">日期时间输入框</option>
                    <option  th:selected="${obj.formAway==6}" value="6">单选下拉列表</option>
                    <option  th:selected="${obj.formAway==7}" value="7">多选下拉框</option>
                    <option  th:selected="${obj.formAway==8}" value="8">文本域</option>
                    <option  th:selected="${obj.formAway==9}" value="9">图片输入</option>
                    <option  th:selected="${obj.formAway==10}" value="10">图片组输入</option>
                    <option  th:selected="${obj.formAway==11}" value="11">文件框</option>

                </select>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">是否需要搜索</label>
            <div class="layui-input-block">
                <select name="isSearch" id="isSearch" lay-verify="required" placeholder="是否需要搜索" th:field="${obj.isSearch}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isSearch==0}" value="0">不需要</option>
                    <option  th:selected="${obj.isSearch==1}" value="1">需要</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">搜索方式</label>
            <div class="layui-input-block">
                <select name="searchWay" id="searchWay"  placeholder="搜索方式" th:field="${obj.searchWay}" >
                    <!--查询方式 1.等于 2.模糊匹配 3.小于 4大于 5小于等于 6大于等于 7.包含-->
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.searchWay==1}" value="1">等于</option>
                    <option  th:selected="${obj.searchWay==2}" value="2">模糊匹配</option>
                    <option  th:selected="${obj.searchWay==3}" value="3">小于</option>
                    <option  th:selected="${obj.searchWay==4}" value="4">大于</option>
                    <option  th:selected="${obj.searchWay==5}" value="5">小于等于</option>
                    <option  th:selected="${obj.searchWay==6}" value="6">大于等于</option>
                    <option  th:selected="${obj.searchWay==7}" value="7">包含（闭区间）</option>
                    <option  th:selected="${obj.searchWay==8}" value="8">包含（开区间）</option>
                </select>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">是否允许为空</label>
            <div class="layui-input-block">
                <select name="isNull" id="isNull"  placeholder="是否允许为空" th:field="${obj.isNull}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isNull==0}" value="0">允许</option>
                    <option  th:selected="${obj.isNull==1}" value="1">不允许</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否需要显示在详情页上面</label>
            <div class="layui-input-block">
                <select name="isView" id="isView"  placeholder="是否需要显示在详情页上面" th:field="${obj.isView}" >
                    <option  value="">-请选择-</option>
                    <option  th:selected="${obj.isView==0}" value="0">不需要</option>
                    <option  th:selected="${obj.isView==1}" value="1">需要</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="">保存表字段基本信息</button>
                <button class="layui-btn" type="button" onclick="backField()">取消</button>
            </div>
        </div>


    </form>
</div>
<script th:inline="javascript" >

    var field_form = layui.form;
    field_form.render(null, 'field_form');
    field_form.on('submit(field_form)',function(){
        var url = /*[[@{/field/update}]]*/
            $.ajax({
                url : url,
                type : "POST",
                async : false,
                dataType : "json",
                data : $("#field_form").serialize(),
                success : function(data) {
                    if(data.code==0){
                        layer.msg(data.msg, {icon: 1});
                        layer.close(filed_table_index);
                        field_tableIns.reload();
                    }else{
                        layer.msg(data.msg, {icon: 5});
                    }
                    /* layer.close(1);*/
                }
            });
        return false;
    })




    function backField() {
        layer.close(filed_table_index);
    }
</script>
</html>